-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable APCu cache for Configuration objects #952
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
need to update documentation: https://github.com/ubccr/xdmod/blob/xdmod8.5/docs/software-requirements.md |
Updated docs as per @plessbd |
jpwhite4
reviewed
Jun 10, 2019
|
||
$fullpath = $this->localConfigDir . '/' . $file; | ||
$this->localConfigFiles[] = $fullpath; | ||
$fileStats = stat($fullpath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should check for a false
return code from stat()
here and output some sort or useful error message.
smgallo
force-pushed
the
config/config-cache-apcu
branch
from
June 11, 2019 12:47
3edc969
to
63fb84b
Compare
@jpwhite4 requested changes made. |
plessbd
approved these changes
Jun 12, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The GroupBy refactor will see data that is currently stored in PHP code moved to configuration files parsed via the
Configuration
classes. While these classes provide additional functionality such as references, include files, and comments, there is a performance overhead for providing these features. This work is an effort to reduce that overhead as well as improve overall performance.Parsed
Configuration
objects are now cached using APCu to improve performance. APCu is a user-space in-memory cache for PHP that uses shared memory to cache data between requests. This cache is not persistent and is cleared on a restart of the web server but for our purposes this is OK as the cache will be reloaded automatically as calls are made. Note that on the first call, performance will be the same as the local configuration object cache as files are parsed and the cache is seeded but on subsequent callsConfiguration
objects will be pulled from the cache with onlyConfiguration::factory()
andConfiguration::__construct()
being called.Changes to global or local configuration files are automatically detected by scanning the global and local configuration files and comparing the maximum modification time of all files to that of the object currently in the cache. If configuration files have been modified, they are re-parsed and the stale configuration object is updated in the cache.
Additional work was also performed:
iConfiguration
interface is now provided that allConfiguration
object code must implement. This specifies the public methods that are available.CURRENT_TIMESTAMP
as a default value would see that value quoted when it should not be.Motivation and Context
Performance improvements prior to GroupBy refactoring.
Tests performed
Implemented new tests.
Types of changes
Checklist: